#coding: utf-8
import json
import time

import datetime

def py_time(is_fifth):
    log = open('F:/twsidom/test/log/time.log','w')
    nowTime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
    if is_fifth == True:
        tit = '十五分钟的推送'
    else:
        tit = '每小时的推送'
    log.write(nowTime+'\n'+tit)

if __name__ == '__main__':
    d = time.localtime()
    if d.tm_hour == 7:
        if d.tm_min == 0:
            py_time(False)
        else:
            py_time(True)
    elif d.tm_hour in [8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]:
        if d.tm_min == 0:
            py_time(False)
        else:
            py_time(True)